<template>
  <div class="container">
      <div class="row">
        <div class="logo">
          <img src="@static/logo.png">
        </div>
        <!-- <div class="col-sm-1 col-md-1 col-lg-1 col-1"></div> -->

        
        <div class="nav_tran d-none d-lg-block">
          <ul>
            <li class="nav" v-for="(item,index) in nav" :key="index"><span class="nav_item" :class="index == listShow ? 'nav_active':''" @click="switchFn(item,index)">{{item.tit}}</span></li>
          </ul>
        </div>
        <div class="header-btn-container col-8 d-lg-none" ref="headerBtn" @click="headerBtnFn">
                    <button type="button" class="btn-toggle" id="btn-toggle">
                        <span class="btn-toggle-bar"></span>
                        <span class="btn-toggle-bar"></span>
                        <span class="btn-toggle-bar"></span>
                    </button>
        </div>
      </div>
      <div class="list d-md-none"  v-if="list == false">
        <ul class="container">
            <li class="nav-link" v-for="(item,index) in nav" :key="index"><span class="nav_item" :class="index == listShow ? 'nav_active':''" @click="switchFn(item,index)">{{item.tit}}</span></li>
        </ul>
      </div>
      
  </div>
</template>

<script>
export default {
  name:'HomeHeader',
  data(){
    return{
      listShow: 0,
      list:false,
      nav:[{tit:"首页",herf:"###"},
      {tit:"系统介绍",herf:"###"},
      {tit:"价值能力",herf:"###"},
      {tit:"渠道合作",herf:"###"},
      {tit:"关于我们",herf:"###"}]
    }
  },
  methods:{
    homeheader(type) {
      console.log('ffffffff',type)
      this.listShow = type
    },
    switchFn(item,index){
      this.listShow = index
      this.$emit('homeheader',this.listShow)
      console.log(this.listShow)
      console.log(this.serviceCon)
      // if(this.service){
      //   this.listShow = this.service
      // }
    },
    nativeFn(){
      his.listShow = this.contact
    },
    headerBtnFn(){
      console.log("A")
      this.list = !this.list

    }
  },
  watch:{
    message: 'nativeFn'
  }
}
</script>

<style lang="stylus" scoped>
@media (min-width: 300px) {
    .container{
        width:90%     
        margin: 0 auto
    }
}
  .container

    background-color:#FFFFFF
    background-size: cover
    width:100%
    // height:265px
    .row
        display:flex
        // width:1200px
        margin:0 auto
        overflow:hidden
        justify-content:space-between
        // border-bottom:1px solid #dadada !important
        .logo
          // width:178px
          height: 65px
          margin-left: 0px
          img
            width:100%
            height: 100%
        .nav_tran
          display: flex
          ul
            display:flex
            
            
            
            .nav
              font-size: 18px
              height: 64px
              line-height: 64px
              
              .nav_item
                height:64px
                color: #5D5D5D;
                display: block
                cursor: pointer
                text-align center
                padding-left:20px
                padding-right:20px

                &:hover
                  color:red
              .nav_active
                color:rgba(255,255,255,1);
                background:rgba(97,114,239,1);
    .list
      height:200px
      text-align:center
      height:200px
      border-bottom:1px solid #dadada
      .container
        .nav-link
          .nav_item
            &:hover
              color:red
        
      

.header-btn-container,
.header-nav-container {
    height: 64px;
}
.header-btn-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.btn-toggle {
    padding: 10px;
    background-color: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-toggle:hover {
    background-color: #f9f9f9;
}
.btn-toggle:hover .btn-toggle-bar {
    background-color: #1428a0;
}
.btn-toggle-bar {
    display: block;
    width: 24px;
    height: 4px;
    background-color: #363636;
    border-radius: 2px;
}
.btn-toggle-bar + .btn-toggle-bar {
    margin-top: 4px;
}
.nav-link {
    display: block;
    height: 40px;
    line-height: 40px;
    font-weight: bold;
    cursor:pointer
} 

</style>